<template>
  <div class="form-wrap">
    <div class="clearfix title">
      <span class="h3">操作日志</span>
      {{ title }}
    </div>
    <keep-alive >
      <router-view
        :table-title="tableTitle"
        :searchable="false"
        :filterable="true"
        :creatable="false"
        :operable="true"
        :editable="false"
        :table-data="tableData"
        :create-path="createPath"
        :edit-path="editPath"
        @childTitle="childTitle"
        @selectionChange="selectionChange"/>
    </keep-alive>
  </div>
</template>

<script>
export default {
  data() {
    return {
      title: '',
      createPath: 'logs.create',
      editPath: 'logs.edit',
      tableTitle: [
        {
          cn: 'id',
          en: 'id'
        },
        {
          cn: 'Name',
          en: 'name'
        },
        {
          cn: 'methods',
          en: 'methods'
        },
        {
          cn: 'path',
          en: 'path'
        },
        {
          cn: 'ip',
          en: 'ip'
        },
        {
          cn: 'input',
          en: 'input'
        },
        {
          cn: '创建时间',
          en: 'create_time'
        }
      ],
      tableData: [
        {
          id: 1,
          name: 'admin',
          methods: 'get',
          path: 'admin/ad',
          ip: '192.168.1.1',
          input: '{a:1,b:2}',
          create_time: '2017-12-27 13:48:47'
        },
        {
          id: 2,
          name: 'admin',
          methods: 'get',
          path: 'admin/ad',
          ip: '192.168.1.1',
          input: '{a:1,b:2}',
          create_time: '2017-12-27 13:48:47'
        },
        {
          id: 3,
          name: 'admin',
          methods: 'get',
          path: 'admin/ad',
          ip: '192.168.1.1',
          input: '{a:1,b:2}',
          create_time: '2017-12-27 13:48:47'
        }
      ]
    }
  },
  methods: {
    selectionChange(val) {
    },
    childTitle(val) {
      this.title = val
    }
  }
}
</script>

<style scoped>

</style>
